public class HTTPCalloutsDemo_XMLParser {
	
	
	public void writeXMLContent()
	{
		
	}
	
	public void readXMLContent()
	{
		
	}
	
	public String getXml() {
			XmlStreamWriter w = new XmlStreamWriter();
			w.writeStartDocument(null, '1.0');
			w.writeProcessingInstruction('target', 'data');
			w.writeStartElement('m', 'Library', 'http://www.book.com');
			//w.writeNamespace('m', 'http://www.book.com');
			w.writeComment('Book starts here');
			w.setDefaultNamespace('http://www.defns.com');
			w.writeCData('<Cdata> I like CData </Cdata>');
			w.writeStartElement(null, 'book', null);
			w.writedefaultNamespace('http://www.defns.com');
			w.writeAttribute(null, null, 'author', 'Manoj');
			w.writeCharacters('This is my book');
			w.writeEndElement(); //end book
			w.writeEmptyElement(null, 'ISBN', null);
			w.writeEndElement(); //end library
			w.writeEndDocument();
			String xmlOutput = w.getXmlString();
			w.close();
			return xmlOutput;
		}
		
		public String domWriterExp()
		{
			Dom.Document d=new Dom.Document();
			Dom.Xmlnode xmlnodeObj=d.createRootElement('name', 'http://w3schools.com', 'm');
			xmlnodeObj.setNamespace('k','http://www.ally.com');
			xmlnodeObj.setAttributeNs('foo', 'bar', 'http://w312schools.com', 'http://www.213ally.com');
			
			xmlnodeObj.setAttribute('myname','Narasimha');
			Dom.Xmlnode fname=xmlnodeObj.addChildElement('FirstName', 'http://w3schools.com', 'J');
			fname.addTextNode('Narasimha Rao');
			fname.addCommentNode('This is the first Name Node');
			xmlnodeObj.addChildElement('LastName', 'http://w3schools.com', 'J').addTextNode('Srirangam');
			return d.toXmlString();
		}
	}